import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;


public class SaeifC {

	private BurningForstSimulation simulation;
	private int limit =100000;
	private int sampling =200;
	
	
	public void startTest() throws IOException {
        BufferedWriter out = new BufferedWriter(new FileWriter("out.txt"));
        
		simulation=  new BurningForstSimulation();
		simulation.d_plantingProb=1;
		simulation.f_lightningStrikeProb=0.00000001;
		simulation.p_growNewPlantProb=0.001;
		simulation.g_combustibilityProb=0.75;
        simulation.initCellularAutomaton();
		
        for (int i = 0; i < limit; i++) {
			if (i%sampling==0){
				double measure = simulation.getGlobalMeasure();
				System.out.println("global measure is  " +measure);
				out.write(i+";"+measure+"\r\n");
			}
			simulation.evolveToNextGeneration();
		}
        
		out.flush();
		out.close();
	}
	
	
}
